Skip to content

fix(auth): bypass client-side router with native window redirect - #101

Merged
saifulalomdev merged 1 commit into
mainfrom
features
Jun 17, 2026
Merged

fix(auth): bypass client-side router with native window redirect#101
saifulalomdev merged 1 commit into
mainfrom
features

Conversation

@saifulalomdev

Copy link
Copy Markdown
Owner

📝 Description

This PR resolves a client-side navigation bottleneck where the production runtime failed to execute smooth-state navigation after a successful login hook resolution. It safely falls back to a clean, browser-native redirection approach.

Key Changes:

  • Routing Isolation: Replaced Astro's client-side Maps() utility with a native browser window.location.assign("/dashboard") initialization. This isolates the redirection sequence from potential edge script deferral, caching mismatches, or Cloudflare optimization overrides (e.g., Rocket Loader).
  • Import Cleanup: Dropped the now unused Maps function dependency import from astro:transitions/client.

Fixes # (issue number)

🧪 Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor / Chore (codebase maintenance or optimization)

🛠️ How Has This Been Tested?

  • Deployed and validated that browser form states successfully execute a complete hard redirect cycle directly into the authenticated route upon receipt of a valid backend payload response.

  • Inspected development and production builds to ensure no lingering dependency type errors remain.

  • Unit/Integration tests added/passed

  • Local manual edge verification successful

📸 Screenshots / Diffs (if applicable)

Modified File: src/modules/auth/auth.hooks.ts

✅ Checklist

  • My code follows the brutalist/minimal style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new typescript compiler or linter errors

- Replace Astro client-side `Maps` with native `window.location.assign`
- Isolate production routing pipeline from SPA script deferral or Rocket Loader interference
- Remove unused `Maps` import from `astro:transitions/client`
@saifulalomdev
saifulalomdev merged commit c0022a6 into main Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant